package lianxi4;
//销售人员类
public class SalesEmployee extends ColaEmployee {
    private double monthSales;//月销售额
    private double royaltyRate;//提成率

    public SalesEmployee(String name, int birthMonth, double monthSales, double royaltyRate) {
        super(name, birthMonth);
        this.monthSales = monthSales;
        this.royaltyRate = royaltyRate;
    }

    @Override
    public double getSalary(int month) {
        if(getBirthMonth()==month){
            return monthSales+monthSales*royaltyRate+100;
        }
        return monthSales+monthSales*royaltyRate;
    }
}
